<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="author" content="wangyuguo">
		<title>操作日志</title>
		<script language="javascript" type="text/javascript" src="../script/common.js"></script>
		<script language="javascript" type="text/javascript">
			//全局变量
			var org = Common.cOrg();	//当前单位
			var qt = null;				//数据表格对象
			
			function load(){
				Eui.showNavigation();
				searchForm.orgName.value = Common.cOrg().name;
				searchForm.organization.value = Common.cOrg().id;
				
				Eui.initBeginDateInput("beginDateTd","起始日期","searchForm","startTime","endTime","_pastDate");
				Eui.initEndDateInput("endDateTd","结束日期","searchForm","startTime","endTime","_pastDate");
				var list = Common.getItems("log_list")
				var arr = []
				for(var i=0;i<list.length;i++){
					if(list[i].code<110001||(list[i].code>121000&&list[i].code<122000)){
						arr.push(list[i])
					}
				}
				Common.initDict(searchForm.type,arr,"全部");
				//log_list
				createTable();
			}
			
			/**查询部分**/
			//生成querytable
			function createTable(){
				var columns = []
				columns[4] = {defOrder:"asc"}			
				qt = new QueryTable("operate_log","searchForm","datalist",columns);
				qt.paramFunc = function(){
					var params = Common.getValues(searchForm);
					if (org.orgLevel != Constants.ORG_LEVEL_HQ){
						params.orgLevel = org.orgLevel;
						params.orgId = org.id;
					}	
				/*	if (params.type){
						params.startType = params.type;
						params.endType = parseInt(params.type) + 10000;
					}*/
					return params;
				}
			}
			
			//显示、刷新表格
			function showData(){
				if(!checkForm(searchForm))return;
				qt.showTable();				
			}
			//选择单位控件 回调方法
			function setOrg(sorg){
				searchForm.orgName.value = sorg.name;	
				searchForm.organization.value = sorg.id;
			}
		</script>
	</head>
	<body onload="load()">
		<div class="nav"><div id="nav">&nbsp;</div></div>
		<div id="listview">	
			<!--查询form-->
			<div class="searchForm">
				<form id="searchForm" name="searchForm">
					<input type="hidden" name="organization">
					<table cellSpacing="0" cellPadding="4" width="100%" border="0" class="label4">
						<tr>
							<td>
								<label>帐  号</label>
								<input type="text" name="loginName" maxlength="20">
							</td>
							<td>
								<label>姓 名</label>
								<input type="text" name="name" maxlength="20">
							</td>
							<td>
								<label>日志类型</label>
								<select name="type"><option></option></select>
							</td>	
							<td>&nbsp;</td>			
						</tr>
						<tr>
							<td>
								<label>所属机构</label>
								<input type="text" name="orgName" maxlength="20" readonly class="readonly"><a class="orga" href="#" onclick="SystemMgnt.selOrg(setOrg)">&nbsp;&nbsp;</a>
							</td>		
							<td id="beginDateTd">&nbsp;</td>	
							<td id="endDateTd">&nbsp;</td>	
							<td><button type="button" onclick="showData()">查 询</button></td>
						</tr>
					</table>
				</form>
			</div>
			<div id="datalist"></div>
		</div>
	</body>
</html>